﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Imaging;

using FirstFloor.Documents;

namespace SampleBrowser.Common.MetadataViewModel
{
    /// <summary>
    /// Represents an intermediate data layer that adds view model functionality on top of the XPS data model.
    /// </summary>
    public abstract class Node
        : INotifyPropertyChanged
    {
        /// <summary>
        /// Occurs when a property value changes.
        /// </summary>
        public event PropertyChangedEventHandler PropertyChanged;

        /// <summary>
        /// Initializes a new instance of the <see cref="Node"/> class.
        /// </summary>
        /// <param name="options">The options.</param>
        protected Node(ViewModelOptions options)
        {
            this.Options = options;
        }

        /// <summary>
        /// Called when a property value has changed.
        /// </summary>
        /// <param name="propertyName">Name of the property.</param>
        protected void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null) {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        /// <summary>
        /// Gets the tree model options.
        /// </summary>
        /// <value>The options.</value>
        public ViewModelOptions Options { get; private set; }

        /// <summary>
        /// Gets the text.
        /// </summary>
        /// <value>The text.</value>
        public virtual string Text
        {
            get { return null; }
        }

        /// <summary>
        /// Gets the icon.
        /// </summary>
        /// <value>The icon uri.</value>
        public virtual string Icon
        {
            get { return null; }
        }

        /// <summary>
        /// Gets the page that is associated with this node instace.
        /// </summary>
        /// <value>The page.</value>
        public virtual PageContent Page
        {
            get { return null; }
        }

        /// <summary>
        /// Gets the child nodes.
        /// </summary>
        /// <value>The nodes.</value>
        public virtual IEnumerable<Node> Children
        {
            get { return null; }
        }
    }
}
